Skip to content

[ISSUE #6404]🚀Implement DecodeMessageId Command for Message ID Parsing Utility#6622

Merged
mxsm merged 1 commit intomxsm:mainfrom
WaterWhisperer:feat-6404
Mar 2, 2026
Merged

[ISSUE #6404]🚀Implement DecodeMessageId Command for Message ID Parsing Utility#6622
mxsm merged 1 commit intomxsm:mainfrom
WaterWhisperer:feat-6404

Conversation

@WaterWhisperer
Copy link
Contributor

@WaterWhisperer WaterWhisperer commented Mar 1, 2026

Which Issue(s) This PR Fixes(Closes)

Brief Description

How Did You Test This Change?

Summary by CodeRabbit

  • New Features
    • Added decodeMessageId command to decode RocketMQ message IDs and retrieve associated broker information, including IP address, port, and commit log offset.
    • Supports both IPv4 and IPv6 format message IDs with input validation.

@rocketmq-rust-bot
Copy link
Collaborator

🔊@WaterWhisperer 🚀Thanks for your contribution🎉!

💡CodeRabbit(AI) will review your code first🔥!

Note

🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥.

@rocketmq-rust-robot rocketmq-rust-robot added the feature🚀 Suggest an idea for this project. label Mar 1, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between da0bba5 and 2859a9f.

📒 Files selected for processing (3)
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/message.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/message/decode_message_id_sub_command.rs

Walkthrough

This PR implements the decodeMessageId command in rocketmq-admin-core, enabling parsing of RocketMQ message ID strings to extract embedded broker IP, port, and commit log offset metadata without querying brokers.

Changes

Cohort / File(s) Summary
Command Registration
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands.rs
Registers the new decodeMessageId command in the static command classification table under the Message category.
Module Wiring
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/message.rs
Exposes new decode_message_id_sub_command module, imports DecodeMessageIdSubCommand, extends MessageCommands enum with new variant, and wires execution handler.
Implementation
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/message/decode_message_id_sub_command.rs
Implements DecodeMessageIdSubCommand to accept multiple message IDs, validate hexadecimal format, decode using rocketmq_common::MessageDecoder, and output broker IP, port, commit log offset, and hexadecimal offset with error handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Poem

🐰 A command so keen to decode,
Message IDs shed their hidden load,
IP, port, and offset now clear,
No broker queries needed here! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title clearly summarizes the main change: implementing the DecodeMessageId command for message ID parsing as specified in issue #6404.
Linked Issues check ✅ Passed Code changes implement all core requirements: DecodeMessageIdSubCommand accepts --messageId/-i flag with multiple values, validates 32/40-char hex strings, decodes IP/port/offset from bytes, and displays formatted output.
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #6404: adding the decodeMessageId command module, enum variant, and execution logic with no unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Mar 1, 2026

Codecov Report

❌ Patch coverage is 0% with 41 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.34%. Comparing base (5f978f3) to head (2859a9f).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
.../commands/message/decode_message_id_sub_command.rs 0.00% 35 Missing ⚠️
...rocketmq-admin/rocketmq-admin-core/src/commands.rs 0.00% 5 Missing ⚠️
...-admin/rocketmq-admin-core/src/commands/message.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6622      +/-   ##
==========================================
- Coverage   41.36%   41.34%   -0.02%     
==========================================
  Files         964      965       +1     
  Lines      135270   135314      +44     
==========================================
- Hits        55959    55951       -8     
- Misses      79311    79363      +52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@rocketmq-rust-bot rocketmq-rust-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - All CI checks passed ✅

Copy link
Owner

@mxsm mxsm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mxsm mxsm merged commit c942994 into mxsm:main Mar 2, 2026
10 of 20 checks passed
@rocketmq-rust-bot rocketmq-rust-bot added approved PR has approved and removed ready to review waiting-review waiting review this PR labels Mar 2, 2026
@WaterWhisperer WaterWhisperer deleted the feat-6404 branch March 2, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI review first Ai review pr first approved PR has approved auto merge feature🚀 Suggest an idea for this project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature🚀] Implement DecodeMessageId Command for Message ID Parsing Utility

4 participants